Clover coverage report - Enterprise Web Services - 1.0
Coverage timestamp: Mon May 30 2005 17:10:32 CEST
file stats: LOC: 63   Methods: 1
NCLOC: 41   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
WrapperClassGeneratorFactory.java 20% 30.4% 100% 27.3%
coverage coverage
 1   
 /*
 2   
  * Copyright 2001-2004 The Apache Software Foundation.
 3   
  * 
 4   
  * Licensed under the Apache License, Version 2.0 (the "License");
 5   
  * you may not use this file except in compliance with the License.
 6   
  * You may obtain a copy of the License at
 7   
  * 
 8   
  *      http://www.apache.org/licenses/LICENSE-2.0
 9   
  * 
 10   
  * Unless required by applicable law or agreed to in writing, software
 11   
  * distributed under the License is distributed on an "AS IS" BASIS,
 12   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13   
  * See the License for the specific language governing permissions and
 14   
  * limitations under the License.
 15   
  */
 16   
 package org.apache.geronimo.ews.ws4j2ee.toWs.wrapperWs;
 17   
 
 18   
 import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
 19   
 import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants;
 20   
 import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
 21   
 import org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault;
 22   
 import org.apache.geronimo.ews.ws4j2ee.toWs.Writer;
 23   
 import org.apache.geronimo.ews.ws4j2ee.toWs.wrapperWs.geronimo.InternalBasedWrapperClassWriter;
 24   
 import org.apache.geronimo.ews.ws4j2ee.toWs.wrapperWs.geronimo.RemoteInterfacedBasedWrapperClassWriter4Geronimo;
 25   
 import org.apache.geronimo.ews.ws4j2ee.toWs.wrapperWs.jboss.RemoteInterfacedBasedWrapperClassWriter4JBoss;
 26   
 import org.apache.geronimo.ews.ws4j2ee.toWs.wrapperWs.jonas.RemoteInterfacedBasedWrapperClassWriter4JOnAS;
 27   
 
 28   
 /**
 29   
  * @author Srinath Perera(hemapani@opensource.lk)
 30   
  */
 31   
 public class WrapperClassGeneratorFactory {
 32  11
     public static Writer createInstance(J2EEWebServiceContext context) throws GenerationFault {
 33  11
         String implStyle = context.getMiscInfo().getImplStyle();
 34  11
         String container = context.getMiscInfo().getTargetJ2EEContainer();
 35  11
         if (!context.getMiscInfo().isImplwithEJB()) {
 36  3
             return new WebEndpointWrapperClassWriter(context);
 37  8
         } else if (GenerationConstants.USE_REMOTE.equals(implStyle)
 38   
                 || GenerationConstants.USE_LOCAL_AND_REMOTE.equals(implStyle)) {
 39  8
             if (GenerationConstants.JBOSS_CONTAINER.equals(container))
 40  8
                 return new RemoteInterfacedBasedWrapperClassWriter4JBoss(context);
 41  0
             else if (GenerationConstants.GERONIMO_CONTAINER.equals(container))
 42  0
                 return new RemoteInterfacedBasedWrapperClassWriter4Geronimo(context);
 43  0
             else if (GenerationConstants.JONAS_CONTAINER.equals(container))
 44  0
                 return new RemoteInterfacedBasedWrapperClassWriter4JOnAS(context);
 45   
             else
 46  0
                 throw new UnrecoverableGenerationFault("No proper Wrapper Class generator found");
 47  0
         } else if (GenerationConstants.USE_LOCAL.equals(implStyle)) {
 48  0
             return new SimpleLocalInterfaceBasedWrapperClassWriter(context);
 49  0
         } else if (GenerationConstants.USE_INTERNALS.equals(implStyle)) {
 50  0
             if (GenerationConstants.JBOSS_CONTAINER.equals(container)) {
 51   
                 //jboss internals
 52  0
                 throw new UnrecoverableGenerationFault("This combination not supported" + implStyle + "|" + container);
 53  0
             } else if (GenerationConstants.GERONIMO_CONTAINER.equals(container)) {
 54  0
                 return new InternalBasedWrapperClassWriter(context);
 55  0
             } else if (GenerationConstants.JONAS_CONTAINER.equals(container))
 56  0
                 throw new UnrecoverableGenerationFault("This combination not supported" + implStyle + "|" + container);
 57   
             else
 58  0
                 throw new UnrecoverableGenerationFault("No proper Wrapper Class generator found");
 59   
         }
 60  0
         throw new UnrecoverableGenerationFault("No proper Wrapper Class generator found for " + implStyle + "|" + container);
 61   
     }
 62   
 }
 63